import { Injectable } from '@nestjs/common';
import { sha1 } from 'object-hash';
import { WX_TOKEN } from '../../const';

@Injectable()
export class AuthService {

  validate(signature: string, strs: string[]) {
    strs.concat(WX_TOKEN).sort();
    return signature === sha1(strs);
  }
}
